'use strict';

const log4js = require('log4js');
const fs = require('fs');
const path = require('path');
const koaRouter = require('koa-router');
const koaJson = require('koa-json');
const RequestPromise = require('request-promise');
const Util = require('../util.js');

const router = koaRouter();
const logger = log4js.getLogger();

// router.use(koaJson({pretty: true}));
// router.get('/app-web/*', function *(next) {
//   this.body = JSON.parse(yield RequestPromise(`${Util.getHost()}${this.request.originalUrl}`));
//
//   yield next;
// });
//
// router.post('/app-web/*', function *(next) {
//   this.body = yield RequestPromise({
//     method: 'POST',
//     uri: `${Util.getHost()}${this.request.originalUrl}`,
//     body: this.request.body,
//     json: true,
//   });
//
//   yield next;
// });

module.exports = router;
